/*
 * Copyright (c)  2017
 * All rights reserved.
 * ProductInfo.java 2017-09-13 下午7:47
 */

package com.ueboot.weishop.entity.system;

import com.ueboot.weishop.entity.IDEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;


/**
 * 描述:操作日志记录
 * 所有后台与前台用户敏感操作，都会记录相关日志
 * 后台涉及到：基础数据的修改，如品牌，分类，规格。订单，退款、结算等操作
 * 前台涉及到订单、个人信息修改、发票、地址等操作
 *
 * @author yangkui create on 2017-09-13 下午7:47.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_OPT_LOG")
public class OptLogEntity extends IDEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_OPT_LOG")
    @GenericGenerator(name = "WS_OPT_LOG", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_OPT_LOG"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled") })
    @Column(name = "ID",columnDefinition = "INT(20) COMMENT 'id主键'",length = 20)
    private Long id;
    /**
     * 操作IP
     */
    @Column(name = "IP",columnDefinition = "VARCHAR(40) COMMENT '操作IP'",length = 40)
    private String ip;
    /**
     * 操作内容
     */
    @Column(name = "CONTENT",columnDefinition = "VARCHAR(200) COMMENT '操作内容'",length = 200)
    private String content;
    /**
     * 操作人名称（后台为管理员名称，前台为openId和用户名）
     */
    @Column(name = "OPT_NAME",columnDefinition = "VARCHAR(40) COMMENT '操作人名称（后台为管理员名称，前台为openId和用户名）'",length = 40)
    private String optName;
    /**
     * 操作类型：新增|修改|删除
     */
    @Column(name = "OPERATION",columnDefinition = "VARCHAR(40) COMMENT '操作类型：新增|修改|删除'",length = 40)
    private String operation;
    /**
     * 提交到后台的请求参数
     */
    @Column(name = "REQ_PARAMS",columnDefinition = "VARCHAR(200) COMMENT '提交到后台的请求参数'",length = 200)
    private String reqParams;


}